/*
 * Wazuh Vulnerability scanner
 * Copyright (C) 2015, Wazuh Inc.
 * April 5, 2024.
 *
 * This program is free software; you can redistribute it
 * and/or modify it under the terms of the GNU General Public
 * License (version 2) as published by the FSF - Free Software
 * Foundation.
 */

#ifndef _AGENT_RESCAN_LIST_EXCEPTION_HPP
#define _AGENT_RESCAN_LIST_EXCEPTION_HPP

#include "scanContext.hpp"
#include <stdexcept>

/**
 * @brief AgentReScanListException class.
 *
 */
class AgentReScanListException : public std::exception
{
public:
    /**
     * @brief Overload what() method.
     *
     * @return const char*
     */
    // LCOV_EXCL_START
    const char* what() const noexcept override
    {
        return m_msg.what();
    }

    /**
     * @brief Get agent id.
     *
     * @return const std::vector<AgentData>&
     */
    const std::vector<AgentData>& agentList() const
    {
        return m_agentList;
    }

    /**
     * @brief Get no-index value
     *
     * @return This value is used to indicate that the agent list should not be indexed.
     */
    bool noIndex() const
    {
        return m_noIndex;
    }

    /**
     * @brief Construct a new Os Data Exception object
     *
     * @param message message
     * @param agentList list of agents
     * @param noIndex no index
     */
    explicit AgentReScanListException(const std::string& message,
                                      const std::vector<AgentData>& agentList,
                                      const bool noIndex = false)
        : m_msg {message} // NOLINT
        , m_agentList {agentList}
        , m_noIndex {noIndex}
    {
    }
    // LCOV_EXCL_STOP

private:
    std::runtime_error m_msg;
    std::vector<AgentData> m_agentList;
    bool m_noIndex;
};

#endif // _AGENT_RESCAN_LIST_EXCEPTION_HPP
